<template>
	<view class="quotation">
		<view style="background: #FFFFFF;border-radius: 16rpx;margin:0 20rpx 20rpx;padding:20rpx 0 20rpx 20rpx;"
			v-for="(item,index) in list" :key="index">
			<view class="flexJusp" @click="detail(item)">
				<view class="flex" style="margin-bottom:16rpx;">
					<image style="width: 96rpx;height: 96rpx;border-radius:50%;" :src="item.icon"></image>
					<view style="margin-left:16rpx;">
						<view style="font-size: 30rpx;font-weight: bold;">{{item.name}}</view>
						<view style="font-size: 32rpx;font-weight: bold;color: #F25816;">{{item.allpoints}}<text
								style="font-size:22rpx;">分</text></view>
					</view>
				</view>
				<view style="width: 280rpx;height: 60rpx;background: #F2F2F2;border-radius: 30rpx 0rpx 0rpx 30rpx;
font-size: 26rpx;color: #333333;line-height: 60rpx;text-align: center;margin-top:8rpx;">付款后显示师傅号码</view>
			</view>
			<view class="flexJusp" style="margin:0 20rpx 16rpx;" @click="detail(item)">
				<view class="flex" style="line-height:34rpx;font-size:24rpx;color: #333;">
					<view class="flex" style="margin-right: 44rpx;">
						<image style="width:34rpx;height:34rpx;" src="/static/image/01_1ws.png"></image>
						<view style="margin-left:12rpx;">拉黑</view>
					</view>
					<view class="flex" style="margin-right: 44rpx;">
						<!-- <image style="width:34rpx;height:34rpx;" src="/static/image/02_10wd.png"></image> -->
						<!-- <image style="width:34rpx;height:34rpx;" src="/static/image/02_10shouc.png"></image> -->
						<image v-if="item.ok==0" style="width:34rpx;height:34rpx;" src="/static/image/01_1sc.png"></image>
						<image v-else style="width:34rpx;height:34rpx;" src="/static/image/01_1sca.png"></image>
						<view style="margin-left:12rpx;">收藏</view>
					</view>
				</view>
				<view>报价 <text style="color: #E90000;font-weight:bold;">{{item.price}}元</text></view>
			</view>
			<view @click="detail(item)" class="flex" style="background: #F6F6F6;border-radius: 16rpx;font-size:24rpx;padding:16rpx 24rpx;margin-right: 20rpx;">
				<view>
					<view style="font-size:26rpx;width:360rpx;">累计完工<text style="color: #1176EF;"><text style="font-size:30rpx;">{{item.okorder}}</text> 单</text> </view>
					<view style="font-size:26rpx;width:360rpx;margin:10rpx 0;">服务质量<text style="color: #1176EF;"><text style="font-size:30rpx;">{{item.zhiliang}}</text>分</text> </view>
					<view style="font-size:26rpx;">服务时间<text style="color: #1176EF;"><text style="font-size:30rpx;">{{item.time}}</text>分</text> </view>
					<!-- <view style="font-size:26rpx;width:360rpx;">师傅距离<text style="color: #1176EF;"><text style="font-size:30rpx;">5.0</text>公里</text> </view> -->
				</view>
				<view>
					<view style="font-size:26rpx;">上门速度<text style="color: #1176EF;"><text style="font-size:30rpx;">{{item.shudu}}</text>分</text> </view>
					<view style="font-size:26rpx;margin:10rpx 0;">服务态度<text style="color: #1176EF;"><text style="font-size:30rpx;">{{item.taidu}}</text>分</text> </view>

				</view>
			</view>
			<view class="flexJusp">
				<view></view>
				<view class="buttons" @click="xuanze(item)">选择</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				moshi:'',
				id:''
			};
		},
		onLoad(option) {
			this.id = option.id
			this.moshi = option.moshi
			this.loads()
		},
		methods:{
			loads(){
				this.$httpapi('shifulist', 'POST',{orderId:this.id}).then(res => {
					this.list = res.data
				})
			},
			xuanze(item){
        let that = this
				if(this.moshi==3){
					this.$httpapi('addPackageshifu', 'POST', {
						orderId:this.id,
						userid:this.userId,
						price:this.prices,
						couponsId:this.couponsId,
					}).then(res => {
						if (res.code == 200) {
              that.$utils.saveSyncTime()
						}
					})
				}else{
					uni.navigateTo({
						url:'/pages/myOrder/payment/payment?id='+this.id+'&userId='+item.userid+'&price='+item.price
					})
				}


			},
			lahei(){

			},
			shoucang(){

			},
			caozuo(item,type){
				this.$httpapi('caozuo', 'POST',{userid:item.userid,flag:type}).then(res => {
					this.loads()
				})
			},
			detail(item){
				uni.navigateTo({
					url:'/pages/index/MasterDetails/MasterDetails?id='+item.userid
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F7F6FA;
	}
.quotation{
	padding:20rpx 0;
	.buttons{
		margin:18rpx 20rpx 0 0;
		text-align: center;
		width: 138rpx;
		height: 52rpx;
		background: linear-gradient(180deg, #2089FF 0%, #11ACEF 100%);
		border-radius: 28rpx;
		font-size: 26rpx;
		color: #FFFFFF;
		line-height: 52rpx;
	}
}
</style>
